package com.mall.manager.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import net.sf.json.JSONObject;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.util.WebUtils;

import com.mall.manager.service.GardenService;
import com.mall.untils.Page;

/**
 * 单个园所列表
 * @ClassName: GardenController
 * @Description: 
 * @author:wangwenyue wangwenyue@ide365.com
 * @date 2016年7月11日 下午5:33:39
 */
@Controller
@RequestMapping("/manager")
public class GardenController {
	
	
	
	
	@Resource
	private GardenService gardenService;
	
	@RequestMapping("/addGarden")
	@ResponseBody
	public String addGarden(HttpServletRequest request){
		gardenService.addData();
		return null;
	}
	
	
	
	/**
	 * 分页显示单个园所列表 ，按园所类型、园所名称（ID）查询
	 * @param request
	 * @return
	 */
	@RequestMapping("/queryPage")
	public @ResponseBody String queryPage(HttpServletRequest request){
		Map<String, Object> paraMap = WebUtils.getParametersStartingWith(request, "");
		Page page = gardenService.queryPage(paraMap);
		JSONObject fromObject = JSONObject.fromObject(page);
		return String.valueOf(fromObject);
	}
	
	
}
